<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta
    name="viewport"
    content="width=device-width, initial-scale=1.0"
  >
  <meta
    http-equiv="X-UA-Compatible"
    content="ie=edge"
  >
  <title>Document</title>
</head>

<body>
  <div
    id="kfEditorContainer"
    class="kf-editor"
  ></div>
  <script>
    function onSave(editor, cb) {
      kfe.execCommand('get.image.data', function (data) {
        var latex = kfe.execCommand('get.source');
        editor.insertContent('<img data-mce-placeholder data-class="CNFormula"  data-type="CNFormula" src="' + data.img + '" data-latex="' + latex + '" />');
        cb()
      })
    }
  </script>
</body>

</html>